#! /bin/bash
CONFIG_NAMES=(
    # "BASELINE"
    # "LASTPROJ_SOFTMAX"
    # "FC_ARCFACE"
    # "FC_SOFTMAX"
    # "NOTRANS_ARCFACE"
    # "NOTRANS_SOFTMAX"
    # "ALL_PROJECTION"
    # "WITH_RES"
    # "SUBCENTER_2"
    # "SUBCENTER_4"
    # "DW_ACT_RELU"
    # "DW_ACT_RELU6"
    # "DW_ACT_LEAKYRELU"
    # "DW_ACT_ELU"
    # "DW_ACT_MISH"
    # "DW_ACT_SWISH"
    # "DW_ACT_HSWISH"
    # "WITH_E_ACT_GELU"
    # "WITH_E_ACT_RELU"
    # "WITH_E_ACT_RELU6"
    # "WITH_E_ACT_ELU"
    # "WITH_E_ACT_MISH"
    # "WITH_E_ACT_SWISH"
    # "WITH_E_ACT_LEAKYRELU"
    # "WITH_E_ACT_HSWISH"
    # "MDW_DOWNSAMPLE2"
    # "MNV4_FONT_WIDTH"
    "MNV4ConvSmall"
    # "MNV4_FONT_WIDTH"
    "MNV4_FONT_WIDTH_FC"
    # "MNV4_FONT_WIDTH_FC_DOWNSAMPLE2"
    # "MNV4_FONT_DEPTH"
    "MNV4_FONT_DEPTH_FC"
    # "MNV4_FONT_DEPTH_FC_DOWNSAMPLE2"
)

if [ "$1" = "train" ]; then
  # for config in "${CONFIG_NAMES[@]}"; do
  #   echo "正在使用配置训练：$config"
  #   python main.py train \
  #     --model=MobileNetV4_Font \
  #     --dataset_dir=./dataset/MVFR_Bangla/ \
  #     --seeds=42 \
  #     --config_name="$config"
  #   sleep 10
  # done
  # python main.py train --model=MDW_Net --config_name=BASE_EBN --dataset_dir=./dataset/nankai_black/ --seeds=42,7,13,19,21
  # python main.py train --model=MDW_Net --config_name=BASELINE_D --dataset_dir=./dataset/nankai_black/ --seeds=42,7,13,19,21
  # python main.py train --model=MDW_Net --config_name=BASELINE_D_RES --dataset_dir=./dataset/nankai_black/ --seeds=42,7,13,19,21
  # python main.py train --model=MDW_Net --config_name=BASE_EBN --dataset_dir=./dataset/XIKE-CFS-1_black/ --seeds=42,7,13,19,21
  # python main.py train --model=MDW_Net --config_name=ALL_PROJECTION_NOBN --dataset_dir=./dataset/XIKE-CFS-1_black/ --seeds=42,7,13,19,21
  # python main.py train --model=MDW_Net --config_name=ALL_PROJECTION_NOBN --dataset_dir=./dataset/nankai_black/ --seeds=42,7,13,19,21
  # python main.py train --model=MDW_Net --config_name=BASELINE --dataset_dir=./dataset/XIKE-CFS-1_black/ --seeds=42,7,13,19,21
  python main.py train --model=MDW_Net --config_name=BASELINE_XIKE --dataset_dir=./dataset/nankai_black/ --seeds=42,7,13,19,21
  # python main.py train --model=MDW_Net --config_name=BASELINE_XIKE --dataset_dir=./dataset/XIKE-CFS-1_black/ --seeds=42,7,13,19,21
  # python main.py train --model=MDW_Net --dataset_dir=./dataset/XIKE-CFS-1_black/ --seeds=42
  # python main.py train --model=MobileNetV4_Font --dataset_dir=./dataset/nankai_black/ --seeds=42 --config_name=MNV4_FONT_DEPTH
elif [ "$1" = "test" ]; then
  # python main.py test --model=MDW_Net --config_name=BASELINE --pretrained_ckpt_path=./ckpt/NCFS/20250602_011930_MDW_Net_BASELINE/MDW_Net_seed21_acc0.9951.ckpt --dataset_dir=./dataset/nankai_black
  # python main.py test --model=MDW_Net --config_name=DW_ACT_RELU --pretrained_ckpt_path=ckpt/NCFS/20250530_221633_MDW_Net_DW_ACT_RELU/MDW_Net_seed19_acc0.9931.ckpt --dataset_dir=./dataset/nankai_black
  # python main.py test --model=MDW_Net --config_name=DW_ACT_RELU6 --pretrained_ckpt_path=ckpt/NCFS/20250530_223828_MDW_Net_DW_ACT_RELU6/MDW_Net_seed19_acc0.9931.ckpt --dataset_dir=./dataset/nankai_black
  # python main.py test --model=MDW_Net --config_name=DW_ACT_LEAKYRELU --pretrained_ckpt_path=ckpt/NCFS/20250530_230245_MDW_Net_DW_ACT_LEAKYRELU/MDW_Net_seed42_acc0.9939.ckpt --dataset_dir=./dataset/nankai_black
  # python main.py test --model=MDW_Net --config_name=DW_ACT_ELU --pretrained_ckpt_path=ckpt/NCFS/20250530_232514_MDW_Net_DW_ACT_ELU/MDW_Net_seed42_acc0.9916.ckpt --dataset_dir=./dataset/nankai_black
  # python main.py test --model=MDW_Net --config_name=DW_ACT_MISH --pretrained_ckpt_path=ckpt/NCFS/20250530_234757_MDW_Net_DW_ACT_MISH/MDW_Net_seed19_acc0.9942.ckpt --dataset_dir=./dataset/nankai_black
  # python main.py test --model=MDW_Net --config_name=DW_ACT_SWISH --pretrained_ckpt_path=ckpt/NCFS/20250531_001211_MDW_Net_DW_ACT_SWISH/MDW_Net_seed21_acc0.9939.ckpt --dataset_dir=./dataset/nankai_black
  # python main.py test --model=MDW_Net --config_name=DW_ACT_HSWISH --pretrained_ckpt_path=ckpt/NCFS/20250531_004418_MDW_Net_DW_ACT_HSWISH/MDW_Net_seed21_acc0.9939.ckpt --dataset_dir=./dataset/nankai_black
  # python main.py test --model=MDW_Net --config_name=WITH_E_ACT_GELU --pretrained_ckpt_path=ckpt/NCFS/20250531_112233_MDW_Net_WITH_E_ACT_GELU/MDW_Net_seed13_acc0.9910.ckpt --dataset_dir=./dataset/nankai_black
  # python main.py test --model=MDW_Net --config_name=WITH_E_ACT_RELU --pretrained_ckpt_path=ckpt/NCFS/20250531_114748_MDW_Net_WITH_E_ACT_RELU/MDW_Net_seed13_acc0.9919.ckpt --dataset_dir=./dataset/nankai_black
  # python main.py test --model=MDW_Net --config_name=WITH_E_ACT_RELU6 --pretrained_ckpt_path=ckpt/NCFS/20250531_121315_MDW_Net_WITH_E_ACT_RELU6/MDW_Net_seed42_acc0.9931.ckpt --dataset_dir=./dataset/nankai_black
  # python main.py test --model=MDW_Net --config_name=WITH_E_ACT_ELU --pretrained_ckpt_path=ckpt/NCFS/20250531_124049_MDW_Net_WITH_E_ACT_ELU/MDW_Net_seed42_acc0.9902.ckpt --dataset_dir=./dataset/nankai_black
  # python main.py test --model=MDW_Net --config_name=WITH_E_ACT_MISH --pretrained_ckpt_path=ckpt/NCFS/20250531_130934_MDW_Net_WITH_E_ACT_MISH/MDW_Net_seed42_acc0.9942.ckpt --dataset_dir=./dataset/nankai_black
  # python main.py test --model=MDW_Net --config_name=WITH_E_ACT_SWISH --pretrained_ckpt_path=ckpt/NCFS/20250531_133753_MDW_Net_WITH_E_ACT_SWISH/MDW_Net_seed42_acc0.9933.ckpt --dataset_dir=./dataset/nankai_black
  # python main.py test --model=MDW_Net --config_name=WITH_E_ACT_LEAKYRELU --pretrained_ckpt_path=ckpt/NCFS/20250531_141701_MDW_Net_WITH_E_ACT_LEAKYRELU/MDW_Net_seed13_acc0.9933.ckpt --dataset_dir=./dataset/nankai_black
  # python main.py test --model=MDW_Net --config_name=WITH_E_ACT_HSWISH --pretrained_ckpt_path=ckpt/NCFS/20250531_144113_MDW_Net_WITH_E_ACT_HSWISH/MDW_Net_seed21_acc0.9928.ckpt --dataset_dir=./dataset/nankai_black

  # python main.py test --model=MDW_Net --config_name=MDW_DOWNSAMPLE2 --pretrained_ckpt_path=ckpt/DownSample_Expriment/20250602_102144_MDW_Net_MDW_DOWNSAMPLE2/MDW_Net_seed7_acc0.9870.ckpt --dataset_dir=./dataset/nankai_black
  # python main.py test --model=MobileNetV4_Font --config_name=MNV4_FONT_WIDTH_FC_DOWNSAMPLE2 --pretrained_ckpt_path=ckpt/DownSample_Expriment/20250602_110631_MDW_Net_MNV4_FONT_WIDTH_FC_DOWNSAMPLE2/MDW_Net_seed7_acc0.9783.ckpt --dataset_dir=./dataset/nankai_black
  # python main.py test --model=MobileNetV4_Font --config_name=MNV4_FONT_DEPTH_FC_DOWNSAMPLE2 --pretrained_ckpt_path=ckpt/DownSample_Expriment/20250602_115024_MDW_Net_MNV4_FONT_DEPTH_FC_DOWNSAMPLE2/MDW_Net_seed7_acc0.9890.ckpt --dataset_dir=./dataset/nankai_black
  # python main.py test --model=MDW_Net --config_name=WITH_RES --pretrained_ckpt_path=ckpt/NCFS/20250530_210838_MDW_Net_WITH_RES/MDW_Net_seed21_acc0.9933.ckpt --dataset_dir=./dataset/nankai_black
  # python main.py test --model=MDW_Net --config_name=ALL_PROJECTION --pretrained_ckpt_path=ckpt/NCFS/20250530_210825_MDW_Net_ALL_PROJECTION/MDW_Net_seed7_acc0.9928.ckpt --dataset_dir=./dataset/nankai_black
  # 
  # python main.py test --model=MobileNetV4_Font --config_name=MNV4ConvSmall --pretrained_ckpt_path=./ckpt/NCFS/20250531_215851_MobileNetV4_Font_MNV4ConvSmall/MobileNetV4_Font_seed19_acc0.9725.ckpt --dataset_dir=./dataset/nankai_black
  # python main.py test --model=MobileNetV4_Font --config_name=MNV4_FONT_WIDTH_FC --pretrained_ckpt_path=./ckpt/NCFS/20250601_100255_MobileNetV4_Font_MNV4_FONT_WIDTH_FC/MobileNetV4_Font_seed7_acc0.9821.ckpt --dataset_dir=./dataset/nankai_black
  # python main.py test --model=MobileNetV4_Font --config_name=MNV4_FONT_DEPTH_FC --pretrained_ckpt_path=./ckpt/NCFS/20250531_232526_MobileNetV4_Font_MNV4_FONT_DEPTH_FC/MobileNetV4_Font_seed21_acc0.9919.ckpt --dataset_dir=./dataset/nankai_black

  # python main.py test --model=MobileNetV4_Font --config_name=MNV4ConvSmall --pretrained_ckpt_path=./ckpt/XIKE/20250601_144203_MobileNetV4_Font_MNV4ConvSmall/MobileNetV4_Font_seed13_acc0.9630.ckpt --dataset_dir=./dataset/XIKE-CFS-1_black
  # python main.py test --model=MobileNetV4_Font --config_name=MNV4_FONT_WIDTH_FC --pretrained_ckpt_path=./ckpt/XIKE/20250601_154214_MobileNetV4_Font_MNV4_FONT_WIDTH_FC/MobileNetV4_Font_seed21_acc0.9716.ckpt --dataset_dir=./dataset/XIKE-CFS-1_black
  python main.py test --model=MobileNetV4_Font --config_name=MNV4_FONT_DEPTH_FC --pretrained_ckpt_path=./ckpt/XIKE/20250601_204138_MobileNetV4_Font_MNV4_FONT_DEPTH_FC/MobileNetV4_Font_seed21_acc0.9836.ckpt --dataset_dir=./dataset/XIKE-CFS-1_black
  # python main.py test --model=MDW_Net --config_name=BASELINE --pretrained_ckpt_path=ckpt/XIKE/20250603_003142_MDW_Net_BASELINE/MDW_Net_seed13_acc0.9823.ckpt --dataset_dir=./dataset/XIKE-CFS-1_black
  # python main.py test --model=MDW_Net --config_name=ALL_PROJECTION --pretrained_ckpt_path=ckpt/XIKE/20250602_190906_MDW_Net_ALL_PROJECTION/MDW_Net_seed19_acc0.9851.ckpt --dataset_dir=./dataset/XIKE-CFS-1_black
  # python main.py test --model=MDW_Net --config_name=WITH_E_ACT_GELU --pretrained_ckpt_path=ckpt/XIKE/20250602_221524_MDW_Net_WITH_E_ACT_GELU/MDW_Net_seed19_acc0.9813.ckpt --dataset_dir=./dataset/XIKE-CFS-1_black
elif [ "$1" = "free_test" ]; then
  python main.py free_test --model=MobileNetV4_Font --config_name=MNV4ConvSmall --pretrained_ckpt_path=./ckpt/NCFS/20250531_215851_MobileNetV4_Font_MNV4ConvSmall/MobileNetV4_Font_seed19_acc0.9725.ckpt --dataset_dir=./dataset/nankai_black
  # python main.py free_test --model=MobileNetV4_Font --config_name=MNV4_FONT_WIDTH_FC --pretrained_ckpt_path=./ckpt/NCFS/20250601_100255_MobileNetV4_Font_MNV4_FONT_WIDTH_FC/MobileNetV4_Font_seed7_acc0.9821.ckpt --dataset_dir=./dataset/nankai_black
  # python main.py free_test --model=MobileNetV4_Font --config_name=MNV4_FONT_DEPTH_FC --pretrained_ckpt_path=./ckpt/NCFS/20250531_232526_MobileNetV4_Font_MNV4_FONT_DEPTH_FC/MobileNetV4_Font_seed21_acc0.9919.ckpt --dataset_dir=./dataset/nankai_black
  # python main.py free_test --model=MDW_Net --config_name=BASELINE --pretrained_ckpt_path=./ckpt/NCFS/20250602_011930_MDW_Net_BASELINE/MDW_Net_seed21_acc0.9951.ckpt --dataset_dir=./dataset/nankai_black
elif [ "$1" = "max_act_patch" ]; then
  # python main.py max_act_patch --model=ArcFont_v15 --pretrained_ckpt_path=./ckpt/20250321_180100_ArcFont_v15_☆/ArcFont_v15_seed19_acc0.9929.ckpt --dataset_dir=./dataset/nankai_black
  python main.py max_act_patch --model=MDW_Net --config_name=LASTPROJ_SOFTMAX --pretrained_ckpt_path=./ckpt/NCFS/20250530_191820_MDW_Net_LASTPROJ_SOFTMAX/MDW_Net_seed42_acc0.9931.ckpt --dataset_dir=./dataset/nankai_black
elif [ "$1" = "gradCam" ]; then
  # python main.py max_act_patch --model=ArcFont_v15 --pretrained_ckpt_path=./ckpt/20250321_180100_ArcFont_v15_☆/ArcFont_v15_seed19_acc0.9929.ckpt --dataset_dir=./dataset/nankai_black
  python main.py gradCam --model=MDW_Net --config_name=LASTPROJ_SOFTMAX --pretrained_ckpt_path=./ckpt/NCFS/20250530_191820_MDW_Net_LASTPROJ_SOFTMAX/MDW_Net_seed42_acc0.9931.ckpt --dataset_dir=./dataset/nankai_black
elif [ "$1" = "umap" ]; then
  # python main.py umap --model=MDW_Net --config_name=NOTRANS_SOFTMAX --pretrained_ckpt_path=ckpt/NCFS/20250530_204642_MDW_Net_NOTRANS_SOFTMAX/MDW_Net_seed19_acc0.9878.ckpt --dataset_dir=./dataset/nankai_black
  python main.py umap --model=MDW_Net --config_name=BASELINE --pretrained_ckpt_path=ckpt/NCFS/20250602_011930_MDW_Net_BASELINE/MDW_Net_seed21_acc0.9951.ckpt --dataset_dir=./dataset/nankai_black
else
  echo "Invalid Option Selected"
fi